package edu.ubb.remeye.gui.event;

/**
 * Enumeration of event types.
 * 
 * @author Andrew Ianicicau
 *
 */
public enum EventType {

	///////////////////////////////////////////////////////////////////////////////////
	////		ATTRIBUTES - EventType
	///////////////////////////////////////////////////////////////////////////////////

	/**
	 * No event.
	 */
	NO_EVENT,
	
	/**
	 * Key is pressed.
	 */
	KEY_PRESSED,
	
	/**
	 * Key is released.
	 */
	KEY_RELEASED,
	
	/**
	 * Mouse is moved.
	 */
	MOUSE_MOVED,
	
	/**
	 * Single click.
	 */
	MOUSE_CLICKED,
	
	/**
	 * Double click.
	 */
	MOUSE_DOUBLE_CLICKED,
	
	/**
	 * Mouse button is pressed.
	 */
	MOUSE_PRESSED,
	
	/**
	 * Mouse is dragged.
	 */
	MOUSE_DRAGGED,
	
	/**
	 * Mouse is released.
	 */
	MOUSE_RELEASED,
	
	/**
	 * Mouse wheel is rotated.
	 */
	MOUSE_WHEEL;

	
	
	///////////////////////////////////////////////////////////////////////////////////
	////		METHODS - EventType
	///////////////////////////////////////////////////////////////////////////////////
	
	/**
	 * Returns the event type associated to the given ordinal.
	 * @param ordinal Event type ordinal.
	 * @return Event type associated to ordinal.
	 */
	public static EventType getEventType(int ordinal) {
		switch(ordinal) {
		case 1:
			return KEY_PRESSED;
		case 2:
			return KEY_RELEASED;
		case 3:
			return MOUSE_MOVED;
		case 4:
			return MOUSE_CLICKED;
		case 5:
			return MOUSE_DOUBLE_CLICKED;
		case 6:
			return MOUSE_PRESSED;
		case 7:
			return MOUSE_DRAGGED;
		case 8:
			return MOUSE_RELEASED;
		case 9:
			return MOUSE_WHEEL;
		default:
			return NO_EVENT;
		}
	}

}
